import request from './index'

// 获取默认地址
export function getDefaultAddress() {
  return request({
    url: '/address/default',
    method: 'get'
  })
}

// 获取地址列表
export function getAddressList() {
  return request({
    url: '/address/list',
    method: 'get'
  })
}

// 添加地址
export function addAddress(data) {
  return request({
    url: '/address/add',
    method: 'post',
    data
  })
}

// 删除地址
export function deleteAddress(id) {
  return request({
    url: '/address/delete',
    method: 'delete',
    params: { id }
  })
}

// 更新地址
export function updateAddress(data) {
  return request({
    url: '/address/update',
    method: 'post',
    data
  })
}

// 设置默认地址
export function setDefaultAddress(id) {
  return request({
    url: '/address/setDefault',
    method: 'post',
    params: { id }
  })
} 